home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cdxvbf1a / frmtest1.frm (.txt) < prev    next >
Visual Basic Form  |  1999-09-09  |  2KB  |  48 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTest1 
  3.    Caption         =   "Click and double-click me!"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   213
  10.    ScaleMode       =   3  'Pixel
  11.    ScaleWidth      =   312
  12.    StartUpPosition =   3  'Windows Default
  13. Attribute VB_Name = "frmTest1"
  14. Attribute VB_GlobalNameSpace = False
  15. Attribute VB_Creatable = False
  16. Attribute VB_PredeclaredId = True
  17. Attribute VB_Exposed = False
  18. ' The font object
  19. Dim myFont As New CDXVBFont
  20. Private Sub Form_Click()
  21.     ' Clear the screen
  22.     Me.Cls
  23.     myFont.CreateNewFont "fixedsys"
  24.     myFont.SetFont Me
  25.     Randomize
  26.     ' Draw the text
  27.     myFont.GradTextOut Me, 0, 0, RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), "CDXVBFont"
  28.     myFont.GradTextOut Me, 30, 14, RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), "CDXVBFont"
  29.     myFont.GradTextOut Me, 60, 28, RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), "CDXVBFont"
  30.     myFont.GradTextOut Me, 30, 42, RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), "CDXVBFont"
  31.     myFont.GradTextOut Me, 0, 56, RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), "CDXVBFont"
  32. End Sub
  33. Private Sub Form_DblClick()
  34.     Me.Cls
  35.     For i = 0 To Screen.FontCount
  36.         Randomize
  37.         myFont.CreateNewFont Screen.Fonts(i)
  38.         myFont.SetFont Me
  39.         myFont.GradTextOut Me, Int(Rnd * (Me.ScaleWidth - myFont.GetTextWidth(Me, Screen.Fonts(i)))), Int(Rnd * (Me.ScaleHeight - myFont.GetTextHeight(Me, Screen.Fonts(i)))), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), RGB(Int(Rnd * 255), Int(Rnd * 255), Int(Rnd * 255)), Screen.Fonts(i)
  40.     Next i
  41. End Sub
  42. Private Sub Form_Load()
  43.     ' Create font
  44.     myFont.CreateNewFont "fixedsys"
  45.     ' Set font to fixedsys
  46.     myFont.SetFont Me
  47. End Sub
  48.